#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
# @FileName  :users.py
# @Time      :2022/4/22 11:35 AM
# @Author    :Toliong toliong@foxmail.com
"""
"""
# A schema is used to validate data we receive 
# as well as to reformat the data that we want to send to the client/browser.
# 模式用于验证接收到的数据，以及重新格式化想要发送给客户机/浏览器的数据。
"""
from typing import Optional
from pydantic import BaseModel,EmailStr


#properties required during user creation
class UserCreate(BaseModel):
    username: str
    email: EmailStr
    password: str


class ShowUser(BaseModel):   #new
    username: str
    email: EmailStr
    is_active: bool

    class Config():  # tells pydantic to convert even non dict obj to json
        orm_mode = True


if __name__ == "__main__":
    pass
